<template>
    <div class="goodsActive">
        <van-goods-action>
            <van-goods-action-icon 
                :icon="isShow?'star':'star-o'" 
                :text="isShow?'已收藏':'未收藏'" 
                :color="isShow?'#ff5000':'#333'"  
                @click="isShow=!isShow"/>
            <van-goods-action-icon icon="cart-o" text="购物车" :badge="goodsCount" @click="$router.push('/cart')"/>
            <van-goods-action-button type="warning" text="加入购物车" color="#333" @click="addCart"/>
            <van-goods-action-button type="danger" text="立即购买" @click="buyNow"/>
        </van-goods-action>
    </div>
</template>
<script>
export default {
    props:['goodsCount'],
    data() {
        return {
            isShow:false
        }
    },
    methods:{
        addCart(){
            this.$emit('addCart')
        },
        buyNow(){
            this.$toast.loading('功能未开发!')
        }
    }
}
</script>
<style lang="less" scoped>

</style>